We are migrating the bug tracker to github Issues. This is now the preferred way to report NASM bugs.

Self-registration is disabled due to spam issue (mail gorcunov@gmail.com or hpa@zytor.com to create an account)

Bug 3392804 - Preprocessor uses free in one place instead of nasm_free
Summary: Preprocessor uses free in one place instead of nasm_free
Status: CLOSED FIXED
Alias: None
Product: NASM
Classification: Unclassified
Component: Assembler (show other bugs)
Version: 2.16.xx
Hardware: All All
: Medium normal
Assignee: nobody
URL:
Depends on:
Blocks:
 
Reported: 2022-08-24 06:03 PDT by E. C. Masloch
Modified: 2022-11-07 12:11 PST (History)
4 users (show)

Obtained from: Built from git using configure
Generated by: ---
Bug category:
Observed for: ---
Regression: ---
Regression since:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description E. C. Masloch 2022-08-24 06:03:53 PDT
This is at https://github.com/netwide-assembler/nasm/blob/3aebb20f123033dcd767f0abc46b18cbefed8091/asm/preproc.c#L1842

$ git diff
diff --git a/asm/preproc.c b/asm/preproc.c
index 0ff2b518..fb64b6b8 100644
--- a/asm/preproc.c
+++ b/asm/preproc.c
@@ -1841,7 +1841,7 @@ static Token *new_Token_free(Token * next, enum token_type ty
pe,

     if (txtlen <= INLINE_TEXT) {
         memcpy(t->text.a, text, txtlen);
-        free(text);
+        nasm_free(text);
     } else {
         t->text.p.ptr = text;
     }
Comment 1 H. Peter Anvin 2022-11-07 12:11:32 PST
Fix checked in: a131b1129c2fa64dd5853e4bfaf71d4548dd9c50